export const list = [
	{
		type: 1,
		key: 'headimgurl',
		title: '头像',
		tips: '',
		icon: '',
		upload: true,
		edit: false
	},
	{
		type: 2,
		key: 'nickname',
		title: '昵称',
		tips: '',
		icon: '',
		last: true,
		edit: true
	},
	{
		type: 5,
		key: 'mobile',
		title: '绑定手机号',
		tips: '',
		action: 'bindPhone',
		edit: true
	},
	// {
	//   type: 3,
	//   key: 'userId',
	//   title: '用户ID',
	//   tips: '',
	//   icon: ''
	// },
	{
		type: 4,
		key: 'parentId',
		vali: {
			type: 'integer',
			msg: '师傅id不存在'
		},
		title: '师傅ID',
		tips: '',
		icon: '',
		last: true,
		edit: true
	},
	{
		type: 6,
		key: 'name',
		title: '收款人姓名',
		tips: '',
		edit: true
	},
	{
		type: 7,
		key: 'wechat',
		title: '微信号',
		tips: '',
		edit: true
	},
	{
		type: 8,
		key: 'alipay',
		title: '支付宝账号',
		tips: '',
		edit: true,
		last: true
	}
]

export function addInfo(list = [], info = {}) {
	list.map((item, index) => {
		switch (item.type) {
			case 1:
				item.icon = info.headimgurl || ''
				break
			case 2:
				item.tips = info.nickname || ''
				break
			case 3:
				item.tips = info.userId || ''
				break
			case 4:
				item.tips = info.parentId || ''
				info.parentId && (item.edit = false)
				break
			case 5:
				item.tips = info.mobile || ''
				break
			case 6:
				item.tips = info.name || ''
				break
			case 7:
				item.tips = info.wechat || ''
				break
			case 8:
				item.tips = info.alipay || ''
				break
		}
	})
	return list
}
